package com.kaifamiao.exercises.queue;

public class TestKaifamiaoQueue {

    public static void main(String[] args) {

        KaifamiaoQueue<String> q = new KaifamiaoQueue<>();

        q.offer( "孙悟空" );
        q.offer( "孙行者" );
        q.offer( "行者孙" );
        q.offer( "者行孙" );
        System.out.println( q );

        System.out.println( q.get( 2 ) );

        System.out.println( q.peek() );
        System.out.println( q );

        while( q.size() > 0 ) {
            System.out.println( q.poll() );
            System.out.println( q );
        }

        System.out.println( q.peek() );
        System.out.println( q.poll() );

    }

}
